﻿
   function querenxiugai(){
	var  password=$("#password").val();
	var password2=$("#password2").val();
	var password3=$("#password3").val();
	if(password2==password3){   
	       	$.ajax({   
 url: urlcore + "/api/user/updatePwd?oldPassword="+password+"&newPassword="+password2+"&newPasswordConfirm="+password3,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					//loginout();
					alert("修改成功");
					window.location.href="../index.html";
				}else{
						alert("新旧密不一致.");
		
				}
			},
			error: function() {
				alert("error");
			}
		});
	    
	}else{
		alert("新旧密不一致.");
		
	}
}



function loginout() {
	$.ajax({
		url: urlcore + "/api/login/logout",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
					window.location.href="../1.0.0denglu.html";
			} else {
			  alert("退出未成功！");
			}
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});
}


